.class public final Les/cw;
.super Les/dw;
.source "DirStore.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Les/cw$e;,
        Les/cw$c;,
        Les/cw$f;,
        Les/cw$d;
    }
.end annotation


# static fields
.field private static m:Landroid/util/LruCache;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Landroid/util/LruCache<",
            "Ljava/lang/String;",
            "Les/cw$d;",
            ">;"
        }
    .end annotation
.end field

.field private static n:Ljava/util/concurrent/atomic/AtomicLong;


# instance fields
.field private h:Ljava/util/Map;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Map<",
            "Ljava/lang/String;",
            "Les/cv;",
            ">;"
        }
    .end annotation
.end field

.field private i:Ljava/util/Map;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Map<",
            "Ljava/lang/String;",
            "Ljava/util/List<",
            "Les/dv;",
            ">;>;"
        }
    .end annotation
.end field

.field private j:Ljava/util/Set;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Set<",
            "Les/cv;",
            ">;"
        }
    .end annotation
.end field

.field private k:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field

.field private final l:Lcom/jcraft/jsch/jce/MD5;


# direct methods
.method static constructor <clinit>()V
    .locals 2

    .line 1
    new-instance v0, Landroid/util/LruCache;

    const/16 v1, 0x200

    invoke-direct {v0, v1}, Landroid/util/LruCache;-><init>(I)V

    sput-object v0, Les/cw;->m:Landroid/util/LruCache;

    const/4 v0, 0x0

    .line 2
    sput-object v0, Les/cw;->n:Ljava/util/concurrent/atomic/AtomicLong;

    return-void
.end method

.method public constructor <init>()V
    .locals 4

    .line 1
    invoke-direct {p0}, Les/dw;-><init>()V

    .line 2
    new-instance v0, Ljava/util/HashSet;

    invoke-direct {v0}, Ljava/util/HashSet;-><init>()V

    iput-object v0, p0, Les/cw;->j:Ljava/util/Set;

    .line 3
    new-instance v0, Ljava/util/ArrayList;

    const/16 v1, 0x14

    invoke-direct {v0, v1}, Ljava/util/ArrayList;-><init>(I)V

    iput-object v0, p0, Les/cw;->k:Ljava/util/List;

    .line 4
    new-instance v0, Lcom/jcraft/jsch/jce/MD5;

    invoke-direct {v0}, Lcom/jcraft/jsch/jce/MD5;-><init>()V

    iput-object v0, p0, Les/cw;->l:Lcom/jcraft/jsch/jce/MD5;

    .line 5
    :try_start_0
    invoke-virtual {v0}, Lcom/jcraft/jsch/jce/MD5;->init()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    .line 6
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    .line 7
    :goto_0
    sget-object v0, Les/cw;->n:Ljava/util/concurrent/atomic/AtomicLong;

    if-nez v0, :cond_0

    .line 8
    invoke-direct {p0}, Les/cw;->g()J

    move-result-wide v0

    .line 9
    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "last path id:"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v2, v0, v1}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    const-string v3, "DirStore"

    invoke-static {v3, v2}, Lcom/estrongs/android/util/n;->c(Ljava/lang/String;Ljava/lang/String;)V

    .line 10
    new-instance v2, Ljava/util/concurrent/atomic/AtomicLong;

    invoke-direct {v2, v0, v1}, Ljava/util/concurrent/atomic/AtomicLong;-><init>(J)V

    sput-object v2, Les/cw;->n:Ljava/util/concurrent/atomic/AtomicLong;

    :cond_0
    return-void
.end method

.method static synthetic a(Les/cw;)Ljava/util/Map;
    .locals 0

    .line 1
    iget-object p0, p0, Les/cw;->h:Ljava/util/Map;

    return-object p0
.end method

.method static synthetic b(Les/cw;)Ljava/util/Map;
    .locals 0

    .line 1
    iget-object p0, p0, Les/cw;->i:Ljava/util/Map;

    return-object p0
.end method

.method static synthetic c(Les/cw;)Ljava/util/Set;
    .locals 0

    .line 1
    iget-object p0, p0, Les/cw;->j:Ljava/util/Set;

    return-object p0
.end method

.method static synthetic d(Les/cw;)Ljava/util/List;
    .locals 0

    .line 1
    iget-object p0, p0, Les/cw;->k:Ljava/util/List;

    return-object p0
.end method

.method static synthetic f()Landroid/util/LruCache;
    .locals 1

    .line 1
    sget-object v0, Les/cw;->m:Landroid/util/LruCache;

    return-object v0
.end method

.method private g()J
    .locals 8

    const-wide/16 v0, 0x0

    const/4 v2, 0x0

    .line 1
    :try_start_0
    iget-object v3, p0, Les/dw;->a:Les/bw;

    invoke-virtual {v3}, Les/bw;->b()V

    .line 2
    iget-object v3, p0, Les/dw;->a:Les/bw;

    const-string v4, "directory"

    const/4 v5, 0x1

    new-array v5, v5, [Ljava/lang/String;

    const-string v6, "max(_id)"

    const/4 v7, 0x0

    aput-object v6, v5, v7

    invoke-virtual {v3, v4, v5, v2, v2}, Les/bw;->a(Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v2

    if-nez v2, :cond_1

    .line 3
    iget-object v3, p0, Les/dw;->a:Les/bw;

    invoke-virtual {v3}, Les/bw;->close()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    if-eqz v2, :cond_0

    .line 4
    invoke-interface {v2}, Landroid/database/Cursor;->close()V

    .line 5
    :cond_0
    iget-object v2, p0, Les/dw;->a:Les/bw;

    invoke-virtual {v2}, Les/bw;->close()V

    return-wide v0

    .line 6
    :cond_1
    :try_start_1
    invoke-interface {v2}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v3

    if-eqz v3, :cond_2

    .line 7
    invoke-interface {v2, v7}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v0
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    :cond_2
    if-eqz v2, :cond_3

    goto :goto_0

    :catchall_0
    move-exception v0

    goto :goto_1

    :catch_0
    move-exception v3

    .line 8
    :try_start_2
    invoke-virtual {v3}, Ljava/lang/Exception;->printStackTrace()V
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    if-eqz v2, :cond_3

    .line 9
    :goto_0
    invoke-interface {v2}, Landroid/database/Cursor;->close()V

    .line 10
    :cond_3
    iget-object v2, p0, Les/dw;->a:Les/bw;

    invoke-virtual {v2}, Les/bw;->close()V

    return-wide v0

    :goto_1
    if-eqz v2, :cond_4

    .line 11
    invoke-interface {v2}, Landroid/database/Cursor;->close()V

    .line 12
    :cond_4
    iget-object v1, p0, Les/dw;->a:Les/bw;

    invoke-virtual {v1}, Les/bw;->close()V

    .line 13
    throw v0
.end method

.method private h()V
    .locals 11

    .line 1
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    iput-object v0, p0, Les/cw;->h:Ljava/util/Map;

    .line 2
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    iput-object v0, p0, Les/cw;->i:Ljava/util/Map;

    const/16 v0, 0x8

    new-array v0, v0, [Ljava/lang/String;

    const-string v1, "_id"

    const/4 v2, 0x0

    aput-object v1, v0, v2

    const/4 v1, 0x1

    const-string v3, "path"

    aput-object v3, v0, v1

    const/4 v1, 0x2

    const-string v3, "name"

    aput-object v3, v0, v1

    const/4 v1, 0x3

    const-string v3, "lastmodified"

    aput-object v3, v0, v1

    const/4 v1, 0x4

    const-string v3, "isLogPath"

    aput-object v3, v0, v1

    const/4 v1, 0x5

    const-string v3, "pathtype"

    aput-object v3, v0, v1

    const/4 v1, 0x6

    const-string v3, "pid"

    aput-object v3, v0, v1

    const/4 v1, 0x7

    const-string v3, "isNomedia"

    aput-object v3, v0, v1

    .line 3
    new-instance v9, Les/cw$a;

    invoke-direct {v9, p0}, Les/cw$a;-><init>(Les/cw;)V

    .line 4
    :goto_0
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    .line 5
    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const/16 v3, 0x2c

    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;

    const/16 v3, 0x3e8

    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    add-int/lit16 v10, v2, 0x3e8

    .line 6
    iget-object v2, p0, Les/dw;->a:Les/bw;

    const/4 v5, 0x0

    const/4 v6, 0x0

    const/4 v7, 0x0

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v8

    const-string v3, "directory"

    move-object v1, v2

    move-object v2, v9

    move-object v4, v0

    invoke-virtual/range {v1 .. v8}, Les/bw;->a(Les/bw$k;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I

    move-result v1

    if-nez v1, :cond_0

    return-void

    :cond_0
    move v2, v10

    goto :goto_0
.end method


# virtual methods
.method public final a(Les/dv;)J
    .locals 9

    .line 2
    sget-object v0, Les/cw;->n:Ljava/util/concurrent/atomic/AtomicLong;

    invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicLong;->incrementAndGet()J

    move-result-wide v7

    .line 3
    new-instance v0, Les/cw$d;

    invoke-virtual {p1}, Les/dv;->l()Z

    move-result v4

    invoke-virtual {p1}, Les/dv;->m()Z

    move-result v5

    invoke-virtual {p1}, Les/dv;->h()I

    move-result v6

    move-object v1, v0

    move-wide v2, v7

    invoke-direct/range {v1 .. v6}, Les/cw$d;-><init>(JZZI)V

    .line 4
    sget-object v1, Les/cw;->m:Landroid/util/LruCache;

    invoke-virtual {p1}, Les/dv;->g()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2, v0}, Landroid/util/LruCache;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 5
    invoke-virtual {p1, v7, v8}, Les/dv;->d(J)V

    .line 6
    invoke-super {p0, p1}, Les/dw;->a(Les/dv;)J

    return-wide v7
.end method

.method public final a()Ljava/lang/String;
    .locals 1

    const-string v0, "directory"

    return-object v0
.end method

.method public final a(Les/cv;)V
    .locals 7

    .line 7
    sget-object v0, Les/cw;->n:Ljava/util/concurrent/atomic/AtomicLong;

    invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicLong;->incrementAndGet()J

    move-result-wide v2

    .line 8
    invoke-virtual {p1, v2, v3}, Les/dv;->d(J)V

    .line 9
    new-instance v0, Les/cw$d;

    invoke-virtual {p1}, Les/dv;->l()Z

    move-result v4

    invoke-virtual {p1}, Les/dv;->m()Z

    move-result v5

    invoke-virtual {p1}, Les/dv;->h()I

    move-result v6

    move-object v1, v0

    invoke-direct/range {v1 .. v6}, Les/cw$d;-><init>(JZZI)V

    .line 10
    sget-object v1, Les/cw;->m:Landroid/util/LruCache;

    invoke-virtual {p1}, Les/dv;->g()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2, v0}, Landroid/util/LruCache;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 11
    new-instance v0, Les/cw$f;

    invoke-direct {v0, p0, p1}, Les/cw$f;-><init>(Les/cw;Les/cv;)V

    .line 12
    invoke-virtual {p0, v0}, Les/dw;->a(Ljava/lang/Runnable;)V

    .line 13
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "add dir to insert:"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p1

    const-string v0, "DirStore"

    invoke-static {v0, p1}, Lcom/estrongs/android/util/n;->a(Ljava/lang/String;Ljava/lang/String;)V

    return-void
.end method

.method public a(Ljava/lang/String;)V
    .locals 2

    .line 14
    sget-object v0, Les/cw;->m:Landroid/util/LruCache;

    invoke-virtual {v0, p1}, Landroid/util/LruCache;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    .line 15
    new-instance v0, Les/cw$c;

    invoke-direct {v0, p0, p1}, Les/cw$c;-><init>(Les/cw;Ljava/lang/String;)V

    .line 16
    invoke-virtual {p0, v0}, Les/dw;->a(Ljava/lang/Runnable;)V

    .line 17
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "send deleteDirectory:"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p1

    const-string v0, "DirStore"

    invoke-static {v0, p1}, Lcom/estrongs/android/util/n;->a(Ljava/lang/String;Ljava/lang/String;)V

    return-void
.end method

.method public b(Ljava/lang/String;)Ljava/util/List;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            ")",
            "Ljava/util/List<",
            "Ljava/lang/Long;",
            ">;"
        }
    .end annotation

    .line 2
    iget-object v0, p0, Les/dw;->a:Les/bw;

    invoke-virtual {v0, p1}, Les/bw;->a(Ljava/lang/String;)Ljava/util/List;

    move-result-object p1

    return-object p1
.end method

.method public b(Les/dw$c;)V
    .locals 1

    .line 3
    new-instance v0, Les/cw$e;

    invoke-direct {v0, p0, p1}, Les/cw$e;-><init>(Les/cw;Les/dw$c;)V

    invoke-virtual {p0, v0}, Les/dw;->a(Ljava/lang/Runnable;)V

    return-void
.end method

.method public c(Ljava/lang/String;)Les/cw$d;
    .locals 7

    .line 2
    sget-object v0, Les/cw;->m:Landroid/util/LruCache;

    invoke-virtual {v0, p1}, Landroid/util/LruCache;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Les/cw$d;

    if-eqz v0, :cond_0

    return-object v0

    :cond_0
    const/4 v0, 0x4

    new-array v4, v0, [Ljava/lang/String;

    const/4 v0, 0x0

    const-string v1, "_id"

    aput-object v1, v4, v0

    const/4 v0, 0x1

    const-string v1, "isLogPath"

    aput-object v1, v4, v0

    const/4 v0, 0x2

    const-string v1, "pathtype"

    aput-object v1, v4, v0

    const/4 v0, 0x3

    const-string v1, "isNomedia"

    aput-object v1, v4, v0

    .line 3
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "path="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-static {p1}, Landroid/database/DatabaseUtils;->sqlEscapeString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    .line 4
    new-instance v2, Les/cw$b;

    invoke-direct {v2, p0, p1}, Les/cw$b;-><init>(Les/cw;Ljava/lang/String;)V

    .line 5
    iget-object v1, p0, Les/dw;->a:Les/bw;

    const/4 v6, 0x0

    const-string v3, "directory"

    invoke-virtual/range {v1 .. v6}, Les/bw;->a(Les/bw$k;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I

    .line 6
    sget-object v0, Les/cw;->m:Landroid/util/LruCache;

    invoke-virtual {v0, p1}, Landroid/util/LruCache;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Les/cw$d;

    return-object p1
.end method

.method public d(Ljava/lang/String;)Les/cw$d;
    .locals 1

    .line 3
    sget-object v0, Les/cw;->m:Landroid/util/LruCache;

    invoke-virtual {v0, p1}, Landroid/util/LruCache;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Les/cw$d;

    return-object p1
.end method

.method protected final d()V
    .locals 0

    .line 2
    invoke-direct {p0}, Les/cw;->h()V

    return-void
.end method

.method public final e(Ljava/lang/String;)J
    .locals 2

    .line 1
    invoke-virtual {p0, p1}, Les/cw;->c(Ljava/lang/String;)Les/cw$d;

    move-result-object p1

    if-nez p1, :cond_0

    const-wide/16 v0, -0x1

    return-wide v0

    .line 2
    :cond_0
    invoke-virtual {p1}, Les/cw$d;->b()J

    move-result-wide v0

    return-wide v0
.end method

.method public final declared-synchronized f(Ljava/lang/String;)Ljava/util/List;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            ")",
            "Ljava/util/List<",
            "Les/dv;",
            ">;"
        }
    .end annotation

    monitor-enter p0

    .line 2
    :try_start_0
    iget-object v0, p0, Les/cw;->i:Ljava/util/Map;

    invoke-interface {v0, p1}, Ljava/util/Map;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Ljava/util/List;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    monitor-exit p0

    return-object p1

    :catchall_0
    move-exception p1

    monitor-exit p0

    throw p1
.end method

.method public final g(Ljava/lang/String;)Les/dv;
    .locals 1

    .line 14
    iget-object v0, p0, Les/cw;->h:Ljava/util/Map;

    invoke-interface {v0, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Les/dv;

    return-object p1
.end method
